Conversation
|
running this on an MI250, rocm 5.6.1, with from codecarbon import EmissionsTracker
import torch
import time
def workload():
matrix1 = torch.randn(1000, 1000, device="cuda")
matrix2 = torch.randn(1000, 1000, device="cuda")
return matrix1 @ matrix2
with EmissionsTracker(tracking_mode="process") as tracker:
start = time.time()
while time.time() - start < 10:
workload()
print("total_energy:", tracker._total_energy.kWh)
print("total_co2:", tracker.final_emissions)I get a coherent output: |
|
Thanks, it's really great! Do you think it's possible to have a machine with both AMD and Nvidia GPU ? Before merging, this PR needs unit tests and documentation. |
|
Apparently it's possible to have both (though very rare), |
|
For the test, we do 'mock' to check the function call. |
| return [] | ||
|
|
||
|
|
||
| def is_gpu_details_available(): |
There was a problem hiding this comment.
Good! Just one comment, maybe instead of removing this you can do
def is_gpu_details_available():
return PYNVML_AVAILABLE or AMDSMI_AVAILABLE
|
@IlyasMoutawwakil any update? |
|
ROCm is not packaged for Python, but I think it is not blocking for this PR, we already have the issue for MacOSX and Windows. To merge this PRR, we need tests and documentation. |
This PR adds support for amd gpus through
amdsmi.#445